
#ifndef _PROJECTTREEWIDGET_H_
#define _PROJECTTREEWIDGET_H_

#include "WidgetsApi.hpp"
#include "../OLCore/AbstractDockWidget.hpp"

#include <QTreeWidgetItem>
#include <QTabWidget>
#include <QLineEdit>
#include <QSplitter>
#include <QComboBox>
#include <QListView>
#include <QLabel>
#include <QMenu>

namespace NSCore {
	class AbstractDataItem;
}


namespace NSWidgets {

	class PrepTree;
	class PostpTree;
	class DataBaseTree;
	class PropertyWidget;

	class WIDGETSAPI ProjectTreeWidget : 
		public  NSCore::AbstractDockWidget
	{
		Q_OBJECT

	private:
		QTabWidget*							m_tree_tab{};
		PrepTree*									m_pretree{};
		PostpTree*								m_posttree{};
		DataBaseTree*							m_database_tree{};
		QLineEdit*								m_tree_search{};
		QSplitter*									m_splitter{};
		PropertyWidget*						m_property{};
		QComboBox*							m_model{};
	private:
		void loadDLLFile();

	signals:
		void actionCurrentModelChanged(int /*Index*/);
		void actionItemRemove(QTreeWidgetItem*);
		void actionshowCurvature(QTreeWidgetItem*, bool);
		void actionSelectionChanged(const QItemSelection& /*selected*/, const QItemSelection& /*deselected*/);
		//DataBase
		void actionDataBaseItemDoubleClicked(QTreeWidgetItem*, int);

	private slots:

	public slots:
		/*SET*/
		NSCore::AbstractDataItem* addModelTree(QString name);
		void removeModelTree(int index);
		/*GET*/
		QTreeWidgetItem* getModelItem(int index);
		QTreeWidgetItem* getCurrentItem();
		inline PropertyWidget* getPropertyWidget() { return m_property; };
		inline PrepTree* getModelTree() { return m_pretree; };
		void actionCurrentModelChangedSlot(int index);
		inline int getCurrentModelId() { return m_model->currentIndex(); };
	public:
		ProjectTreeWidget(QWidget* w = nullptr);
		~ProjectTreeWidget();

	public: /*override*/
		virtual inline QString className() override { return "ProjectTreeWidget"; };

	};


}

#endif


